<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
		<title>主页</title>
		<link rel="stylesheet" href="css/result.css" type="text/css"></link>
		<link rel="stylesheet" href="css/result.css" />
		<script type="text/javascript" src="js/jquery-3.1.1.min.js" ></script>
	</head>
	<body>
		<div class="main">
		<jsp:include page="header.jsp"></jsp:include>
			<div class=clear_float></div>
			<div class="body">
				<img src="images/ioc/logo.jpg" width="180" height="80" /><br />
				<input type="text" class="select_content" />
				<input type="submit" class="submit_select" name="submit_select" value="BUG" />
			</div>
			<div class="hidden" style="display:none;height:auto;"></div>
			<div class="footer">
				<a href="">设为主页</a>
				<a href="">关于bug</a>
				<a href="">bug推广</a>
				<a href="">联系我们</a><br />
				<a href="">@ 2017 版权所有</a>
				<a href="">粤：ICP证030173号</a>
				<a href="">京公网安备11000002000001号 </a>
			</div>
		</div>
		<script type="text/javascript">
			$(function(){
				$(".select_content").on("input",function(){
					var str=$(this).val().trim();
					console.log(str+"--------"+str.length+"-----");
					if(str!=0){
						$.ajax({
						url:"bugInfoController/ajaxFindBug/"+str,
						success:function(msg){
							/*
							1.清空
							2.解析
							3.绑定
							*/
							$(".hidden").empty();
							var obj = eval('(' + msg + ')');
							if(obj.length!=0){
								for(var i=0;i<obj.length;i++){
									var o=obj[i];
									$(".hidden").append("<a href='bugInfoController/findByDescription?description="+o['description']+"' style='width:452px;height:30px;font-size:16px;text-align:center;line-height:30px;display:block;' value='"+o.bugId+"'>"+o['description']+"</a>");
								}
								$(".hidden").show();
								
							}else{
								$(".hidden").hide();
							}
						}
					});
					}else{
						$(".hidden").hide();
					}
				});
			});
		</script>
		
	</body>
</html>